package com.guang.syncronized;

import com.guang.syncronized.domain.ObjectAge;
import org.openjdk.jol.info.ClassLayout;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.ArrayList;
import java.util.List;

/**
 * @Description 测试对象的年龄的时候可以设置参数：-Xmx100m -Xms100m
 * @Author liguang
 * @Date 2022/10/20/10:28
 */
public class ObjectAgeTest {
    private final static Logger logger = LoggerFactory.getLogger(ObjectAgeTest.class);
    public static void main(String[] args) {
        List<ObjectAge> objectAgeList = new ArrayList<>();
        for (int i = 0; i < 300; i++) {
            objectAgeList.add(new ObjectAge());
            logger.info(ClassLayout.parseInstance(objectAgeList.get(0)).toPrintable());
        }
    }
}
